describe("ApplicationController", function(){
    var appController = null;
    beforeEach(function() {
        appController = App.ApplicationController.create();
        App.initSession();

    });

    it("Init method",function(){
        spyOn(appController,"init");
        appController.init();
        expect(appController.init).toHaveBeenCalled();
    });

    it("SetBackground method day",function(){
        Date.prototype.getHours = function() {
            return 7;
        }
        spyOn(appController,"set");
        appController.setBackground();
        expect(appController.set).toHaveBeenCalledWith('timeState','day-state');
    });
    it("SetBackground method night",function(){
        Date.prototype.getHours = function() {
            return 17;
        }
        spyOn(appController,"set");
        appController.setBackground();
        expect(appController.set).toHaveBeenCalledWith('timeState','evening-state');
    });
    it("SetBackground method evening",function(){
        Date.prototype.getHours = function() {
            return 21;
        }
        spyOn(appController,"set");
        appController.setBackground();
        expect(appController.set).toHaveBeenCalledWith('timeState','night-state');
    });
    it("SetBackground method evening",function(){
        Date.prototype.getHours = function() {
            return 6;
        }
        spyOn(appController,"set");
        appController.setBackground();
        expect(appController.set).toHaveBeenCalledWith('timeState','night-state');
    });
});